package com.bw.base.base

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.fragment.app.Fragment

abstract class BaseFragment<VDB: ViewDataBinding>: Fragment() {
    protected lateinit var mdataBinding:VDB

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        mdataBinding= DataBindingUtil.inflate(inflater,getLayoutId(),container,false)
        initView()
        initData()
        handObserver()
        return mdataBinding.root
    }
    abstract fun getLayoutId(): Int
    abstract fun initView()
    abstract fun initData()
    open fun handObserver(){

    }
}